package com.example.demo.repository;

import com.example.demo.entity.Person;
import org.springframework.data.jpa.repository.JpaRepository;
import org.springframework.data.repository.query.Param;
import org.springframework.data.rest.core.annotation.RepositoryRestResource;

import java.util.List;

/**
 * Created by pengwan on 2017/7/29.
 */
@RepositoryRestResource(collectionResourceRel = "person", path = "person") // 在'/person'处创建RESTful入口点
public interface PersonRepository extends JpaRepository<Person, String> {
    List<Person> findByLastNameContains(@Param(value = "lastName") String lastName);
}
